package main

import (
	"fmt"
	"spider/common"
	"spider/fetcher"
)

func main() {

	var url string="https://www.meituan.com/meishi/api/poi/getFoodSafetyDetail"
	//url="http://39.100.78.46/test.php"
	id:=192283292
	referer:=fmt.Sprintf("https://www.meituan.com/meishi/%d/",id)
	err:=common.InitConfig("./conf.json")
	if err!=nil{
		panic(err)
	}

	cookie:=common.G_config.Cookie

	header:=map[string]string{
		"Content-Type":"application/json",
		"Referer":referer,
		"Cookie":cookie,
	}

	header=common.MergreHeader(header,common.CommonHeader)
	var (
		postStr string
	)
	postStr=fmt.Sprintf(`{"poiId":"%d"}`,id)
	result,err:=fetcher.MeiTuanPost(url,header,postStr)
	if err!=nil{
		panic(err)
	}
	fmt.Printf("%s",result)
}
